package com.showcai.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.showcai.dao.ApplyMaintainMapper;
import com.showcai.dao.FeedBackMapper;
import com.showcai.module.ApplyMaintain;
import com.showcai.module.BaseModule;
import com.showcai.module.CertificateBatch;
import com.showcai.module.FeedBack;
import com.showcai.service.ApplyMaintainService;
import com.showcai.service.FeedBackService;
import com.showcai.service.ServiceBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by Baggio on 2018-9-5.
 */
@Service
public class ApplyMaintainServiceImpl extends ServiceBase implements ApplyMaintainService {

    @Autowired
    ApplyMaintainMapper applyMaintainMapper;


    @Override
    public void insertApplyMaintain(ApplyMaintain applyMaintain) {
        applyMaintain.setStatus(BaseModule.STATUS_VALID);
        applyMaintain.setCreateTime(new Date());
        applyMaintainMapper.insertApplyMaintain(applyMaintain);
    }

    @Override
    public PageInfo getApplyMaintainList(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        List<ApplyMaintain> list = applyMaintainMapper.getApplyMaintainList();
        PageInfo<ApplyMaintain> pageinfo = new PageInfo<>(list);
        return pageinfo;
    }
}

